<?php

include_once($ROOT . "base.inc.php");

class PageController extends BaseController {

  var $event;
  var $events;

  var $locations;
  var $contacts;

  function PageController() {
	parent::__construct();

	$this->title = "Events";
	$this->section = "events";

	$action = $this->getParameter("action");
	$this->event = new Event();

	$this->locations = LocationLogic::findAll();
	$this->contacts  = ContactLogic::findAll();

	switch (strtoupper($action))
	{
		case "SEARCH" :
			  $this->parseForm();
			  $this->events = EventLogic::findByExample($this->event);
			  break;
	  	default :
	  		$this->events = EventLogic::findAll();
	}
  }

  function parseForm() {
  	$this->event->pubilc = "F";
  	$this->event->readForm();
  }

  function validate() {
	return (sizeof($this->errs) == 0);
  }

}



?>
